# $Id: PKGBUILD 81967 2013-01-05 03:16:01Z heftig $
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Mateusz Herych <heniekk@gmail.com>
# Contributor: Charles Lindsay <charles@chaoslizard.org>

pkgname=libmirage
pkgver=2.0.0
pkgrel=1
pkgdesc="CD-ROM image (B6T/CCD/CDI/CUE/ISO/MDS/NRG/TOC) access library"
arch=(i686 x86_64)
url="http://cdemu.sourceforge.net/"
license=(GPL)
depends=(glib2 libsndfile zlib bzip2 shared-mime-info)
makedepends=(bison flex gtk-doc cmake gobject-introspection)
options=(!libtool)
install=libmirage.install
source=(http://downloads.sourceforge.net/cdemu/$pkgname-$pkgver.tar.bz2
        soname.diff)
md5sums=('72007f3364cbf3aea782aaa1fdade238'
         '72b5af3d5baf8e9b1ec6afa629373799')

build() {
  cd $pkgname-$pkgver
  patch -Np2 -i ../soname.diff # Produce correct symlinks
  mkdir build; cd build
  cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib
  make
}

package() {
  cd $pkgname-$pkgver/build
  make DESTDIR="$pkgdir" install
}
